<?php
/* @var $this PriceAdminController */
/* @var $model Price */
/* @var $form CActiveForm */
?>
<div class="row-fluid sortable">
	<div class="box span12">
		<div class="box-header well" data-original-title>
			<h2>
				<i class="icon-edit">
				</i>
				<?php
                    FormHelper::getFormBoxHeader('giá');
                ?>
			</h2>
			<div class="box-icon">
				<?php FormHelper::getBoxIcon(); ?>
			</div>
		</div>
		<div class="box-content">
			<?php $form=$this->beginWidget('CActiveForm', array(
            	'id'=>'price-form',
            	// Please note: When you enable ajax validation, make sure the corresponding
            	// controller action is handling ajax validation correctly.
            	// There is a call to performAjaxValidation() commented in generated controller code.
            	// See class documentation of CActiveForm for details on this.
            	'enableAjaxValidation'=>false,
                'htmlOptions'=>array(
                    'class'=>'form-horizontal'
                ),
            )); ?>
				<fieldset>
					<div class="control-group">
            			<label class="control-label" for="typeahead">Danh mục</label>
							  <div class="controls">
                                  <?php echo CHtml::dropDownList('Danh mục','category_id',CHtml::listData(Category::model()->findAll(),'category_id','category_name'),
                                            array(
                                                'ajax'=>array(
                                                        'type'=>'POST',
                                                        'url'=>Yii::app()->createUrl('ProductAdmin/LoadProduct'),
                                                        'update'=>'#Price_product_id',
                                                        'data'=>array(
                                                                    'category_id'=>'js:this.value',
                                                                ),
                                                        ),
                                                 'empty'=>'-- Chọn danh mục --',
                                            )); 
                                  ?>
						      </div>
					</div>
                    <div class="control-group">
            			<?php echo $form->labelEx($model,'product_id',array('class'=>'control-label','for'=>'fileInput')); ?>
    					<div class="controls">
        					<?php echo $form->dropDownList($model,'product_id',array('prompt'=>' -- Chọn sản phẩm -- ')); ?>
                    		<?php echo $form->error($model,'product_id'); ?>
                        </div>
					</div>
                    <div class="control-group">
            			<?php echo $form->labelEx($model,'merchant_id',array('class'=>'control-label','for'=>'fileInput')); ?>
    					<div class="controls">
        					<?php echo $form->dropDownList($model,'merchant_id',CHtml::listData(Merchant::model()->findAll(),'merchant_id','merchant_name'),array('prompt'=>' -- Chọn đại lý -- ')); ?>
                    		<?php echo $form->error($model,'merchant_id'); ?>
                        </div>
					</div>
                    <div class="control-group">
            			<?php echo $form->labelEx($model,'price_value',array('class'=>'control-label','for'=>'typeahead')); ?>
    					<div class="controls">
        					<?php echo $form->textField($model,'price_value',FormHelper::setClass('textField')); ?>
                    		<?php echo $form->error($model,'price_value'); ?>
                        </div>
					</div>
                    <div class="control-group">
            			<?php echo $form->labelEx($model,'price_value_sale',array('class'=>'control-label','for'=>'fileInput')); ?>
    					<div class="controls">
        					<?php echo $form->textField($model,'price_value_sale',FormHelper::setClass('textField')); ?>
                    		<?php echo $form->error($model,'price_value_sale'); ?>
                        </div>
					</div>
                    <div class="control-group">
            			<?php echo $form->labelEx($model,'price_url',array('class'=>'control-label','for'=>'fileInput')); ?>
    					<div class="controls">
        					<?php echo $form->textField($model,'price_url',FormHelper::setClass('textField')); ?>
                    		<?php echo $form->error($model,'price_url'); ?>
                        </div>
					</div>
                    
					<div class="form-actions">
			            <?php echo CHtml::submitButton($model->isNewRecord ? 'Thêm mới' : 'Lưu thay đổi',array('class'=>'btn btn-primary')); ?>
					</div>
				</fieldset>
	<?php $this->endWidget(); ?>
		</div>
	</div>
	<!--/span-->
</div>